<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    let arr = []

    let data = []

    for (let i = 0; i < 5; i++) {
        arr.push(fun(i))
    }

    console.log(arr)
    console.log("result:", data)
    console.log(Promise.all(arr))

    function fun(i) {
        return new Promise((resolve) => {

            i *= 10
            data.push(i)
            resolve(i)
        })
    }
</script>
</body>
</html>
